import { _decorator, Component, tween, Vec3 } from 'cc';
const { ccclass, property } = _decorator;

@ccclass('ScaleAnimationComp')
export class ScaleAnimationComp extends Component {
    
    @property(Number)
    private time: number = 0.2;
    @property(Number)
    private scale: number = 1;
    @property(Number)
    private delay: number = 0;

    start() {
        let myThis = this;
        this.scheduleOnce(function(){
            tween(myThis.node).to(myThis.time, { scale: new Vec3(myThis.scale, myThis.scale, myThis.scale) }).start();
        }.bind(this), this.delay);
    }
}


